<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <input type="text" class="username"> 
    <input type="text" class="password">

    <button class="btn">登录</button>

    <script src="../js/ajax_v2.js"></script>
    <script>


        // get请求是通过地址栏携带数据

        $('.btn').onclick = function() {

            const username = $('.username').value ;
            const password = $('.password').value ;

            if(username && password) {
                ajax(
                    '../php/01get.php' , 
                    {
                        username ,
                        password 
                    } ,
                    res => {
                        console.log(res);
                    }
                )
            }
        }

    </script>
    
</body>
</html>